//=============================================================================
#ifndef __CAPPSTATEGAME_H__
	#define __CAPPSTATEGAME_H__

#include "AppState.h"
#include "SDL_ttf.h"
#include "Area.h"

#include "Camera.h"
#include "Entity.h"
#include "Surface.h"

#include "Player.h"
#include "Items.h"

//=============================================================================
class CAppStateGame : public CAppState {
	private:
		static CAppStateGame Instance;
	private:
		
		TTF_Font* font;
		int yCalcIcons;
		int xCalcIcons;
		SDL_Surface* tabScreen;
		SDL_Surface * itemScreen;
		bool tabScreenON;
		bool itemScreenON;
		SDL_Surface* helpScreen;
		bool helpScreenON;
		std::string IconNameDisplay;
		SDL_Surface* shieldIcon;
		SDL_Surface* disruptIcon;
		SDL_Surface* fireBallIcon;
		SDL_Surface* magicMissileIcon;
		SDL_Surface* frostIcon;
		SDL_Rect cIconRect;
		SDL_Rect dIconRect;
		CAppStateGame();
		CItems itemclass;
		bool colOK;
	public:
		SDL_Surface* backGroundTile;
		SDL_Surface* backGroundTile2;
		void OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);
		void OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode);
		//void OnLButtonDown(int mX, int mY);
		void OnMouseMove(int mX, int mY, int relX, int relY, bool Left,bool Right,bool Middle);
		struct scores
				{
					int  score;
					int deaths;
					std::string  name;
				};

		inline static bool my_cmp(const scores& a, const scores& b);
		

	
	public:
		void OnActivate();

		void OnDeactivate();

		void OnLoop();

		void OnRender(SDL_Surface* Surf_Display);

		void OnKeyDownInterface(SDLKey sym);
		void OnKeyUpInterface(SDLKey sym);
		void OnRenderInterface(SDL_Surface* Surf_Display);
		void OnLoopInterface();

	public:
		double temp2; // Used for a claculation in the castbar.

		SDL_Surface* OnRenderSDLKey(SDLKey input);
	public:
		static CAppStateGame* GetInstance();
};

//=============================================================================

#endif
